From 4c21cf53d87697bfbfb521d99b825a3fd287c77e Mon Sep 17 00:00:00 2001 From: Timo Tijhof Date: Wed, 19 Sep 2012 16:41:28 +0200 Subject: [PATCH] (bug 9237) SpecialBrokenRedirects.php: Exclude iw redirects * Cleaned up code * Difference: Added `(rd_interwiki IS NULL OR rd_interwiki = "")` condition. Change-Id: Ifee9fdcdd3a327742b18cfcc2a235e1e24c062bf --- RELEASE-NOTES-1.20 | 5 ++- includes/specials/SpecialBrokenRedirects.php | 44 ++++++++++++-------- 2 files changed, 30 insertions(+), 19 deletions(-) diff --git a/RELEASE-NOTES-1.20 b/RELEASE-NOTES-1.20 index ba828d8fec..9c4d5b22a6 100644 --- a/RELEASE-NOTES-1.20 +++ b/RELEASE-NOTES-1.20 @@ -247,8 +247,9 @@ upgrade PHP if you have not done so prior to upgrading MediaWiki. * (bug 40214) Category pages no longer use deprecated "width" HTML attribute. * (bug 39941) Add missing stylesheets to the installer pages * In HTML5 mode, allow new input element types values (such as color, range..) -* (bug 40353) SpecialDoubleRedirect should support for interwiki redirects. -* (bug 40352) fixDoubleRedirects.php should support for interwiki redirects. +* (bug 40353) SpecialDoubleRedirect should support interwiki redirects. +* (bug 40352) fixDoubleRedirects.php should support interwiki redirects. +* (bug 9237) SpecialBrokenRedirect should not list interwiki redirects. === API changes in 1.20 === * (bug 34316) Add ability to retrieve maximum upload size from MediaWiki API. diff --git a/includes/specials/SpecialBrokenRedirects.php b/includes/specials/SpecialBrokenRedirects.php index 9fa499cf0f..97de72a118 100644 --- a/includes/specials/SpecialBrokenRedirects.php +++ b/includes/specials/SpecialBrokenRedirects.php @@ -51,25 +51,35 @@ class BrokenRedirectsPage extends QueryPage { function getQueryInfo() { return array( - 'tables' => array( 'redirect', 'p1' => 'page', - 'p2' => 'page' ), - 'fields' => array( 'namespace' => 'p1.page_namespace', - 'title' => 'p1.page_title', - 'value' => 'p1.page_title', - 'rd_namespace', - 'rd_title' + 'tables' => array( + 'redirect', + 'p1' => 'page', + 'p2' => 'page', ), - 'conds' => array( 'rd_namespace >= 0', - 'p2.page_namespace IS NULL' + 'fields' => array( + 'namespace' => 'p1.page_namespace', + 'title' => 'p1.page_title', + 'value' => 'p1.page_title', + 'rd_namespace', + 'rd_title', + ), + 'conds' => array( + // Exclude pages that don't exist locally as wiki pages, + // but aren't "broken" either. + // Special pages and interwiki links + 'rd_namespace >= 0', + '(rd_interwiki IS NULL OR rd_interwiki = "")', + 'p2.page_namespace IS NULL', + ), + 'join_conds' => array( + 'p1' => array( 'JOIN', array( + 'rd_from=p1.page_id', + ) ), + 'p2' => array( 'LEFT JOIN', array( + 'rd_namespace=p2.page_namespace', + 'rd_title=p2.page_title' + ) ), ), - 'join_conds' => array( 'p1' => array( 'JOIN', array( - 'rd_from=p1.page_id', - ) ), - 'p2' => array( 'LEFT JOIN', array( - 'rd_namespace=p2.page_namespace', - 'rd_title=p2.page_title' - ) ) - ) ); } -- 2.20.1